package com.poker.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.poker.entity.SeatedUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SeatedUserMapper extends BaseMapper<SeatedUser> {

    @Select("SELECT SU.*, U.NAME, U.PHOTO FROM RU_SEATED_USER SU LEFT JOIN GE_USER U ON SU.USER_ID = U.USER_ID ORDER BY SU.SEAT_NUM ASC")
    List<SeatedUser> selectAll();

    @Select("SELECT SU.*, U.NAME FROM RU_SEATED_USER SU LEFT JOIN GE_USER U ON SU.USER_ID = U.USER_ID WHERE SU.USER_ID NOT IN ${sql}")
    List<SeatedUser> queryRecorders(@Param("sql") String sql);
}